<?php

Route::get('/sitemap', 'App\Http\Controllers\SitemapController@index');

Route::group(['prefix'=>'','namespace'=>'App\Http\Controllers\Api'],function(){

    Route::get('/', 'H5Controller@homePage');

//    Route::get('xx/project/{parent_category_id?}/{category_id?}/{amount?}/{name?}', 'H5Controller@projectList')->name('h5.project.list');
    Route::get('ajax/project/list/{parent_category_id?}/{category_id?}/{amount?}/{keyword?}', 'H5Controller@ajaxProjectList')->name('h5.ajax.project.list');

    Route::get('news/{news_type?}', 'H5Controller@newsList');
    Route::get('news/child/{news_type?}', 'H5Controller@newsList')->name('h5.news.list');

    Route::get('ajax/news/list/{news_type?}', 'H5Controller@ajaxNewsListNotIndex')->name('h5.ajax.news.list');

    Route::get('ajaxNewsList', 'H5Controller@ajaxNewsList');


    Route::get('rank/{parent_category_id?}/{category_id?}', 'H5Controller@rankProjectList')->name('h5.rank.project.list');
    Route::get('project/detail/{id}', 'H5Controller@projectInfo')->name('project.info');
    Route::get('news/detail/{id}', 'H5Controller@newsInfo')->name('news.info');

    Route::get('search', 'H5Controller@search')->name('search');

});

//apply
Route::any('apply/store', 'App\Http\Controllers\admin\ApplyController@store')->name('apply.store');

Route::fallback(function ($url) {
    $request = app(\Illuminate\Http\Request::class);
    $c = new \App\Http\Controllers\Api\H5Controller();
    return $c->projectList($request);
});